// 医院管理相关的请求
import { request } from "@/utils/http"
//
import {
  IhospitalSetPrams,
  Iresponse,
  hospitalAdd,
  IhospitalModify,
} from "./model"
// 渲染页面,两个必须传递的值和两个可选值，需要时再传递，可以设置默认值
export const getPageList = ({
  page,
  pageSize,
  hosname = "",
  hoscode = "",
}: IhospitalSetPrams) => {
  return request.get<any, Iresponse>(
    `/admin/hosp/hospitalSet/${page}/${pageSize}`,
    {
      params: {
        hosname,
        hoscode,
      },
    }
  )
}

// 删除
export const deleteById = (id: number) => {
  return request.delete<any, null>(`/admin/hosp/hospitalSet/remove/${id}`)
}

// 添加医院
export const addSettings = (list: any) => {
  return request.post<any, null>(`/admin/hosp/hospitalSet/save`, list)
}

// 单个医院获取数据
export const getOneData = (id: number) => {
  return request.get<any, Iresponse>(`/admin/hosp/hospitalSet/get/${id}`)
}

// 修改医院设置
export const hospitalModify = (data: IhospitalModify) => {
  return request.put<any, null>("/admin/hosp/hospitalSet/update", data)
}
// 批量删除
export const deleteListId = (data: any[]) => {
  return request.delete<any, null>(`/admin/hosp/hospitalSet/batchRemove`, {
    data,
  })
}
